{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git config --global user.name \"lyhue1991\"\n",
    "!git config --global user.email \"lyhue1991@163.com\"\n",
    "\n",
    "# 出现一些类似 warning: LF will be replaced by CRLF in <file-name>. 可启用如下设置。\n",
    "!git config --global core.autocrlf false\n",
    "\n",
    "# 配置打印历史commit的快捷命令\n",
    "!git config --global alias.lg \"log --oneline --graph --all\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\r\n"
     ]
    }
   ],
   "source": [
    "!git init"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git add -A "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[master 79dc949] v06\r\n",
      " 3 files changed, 1358 insertions(+), 111 deletions(-)\r\n"
     ]
    }
   ],
   "source": [
    "!git commit -m\"v06\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git remote remove origin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git remote add origin https://github.com/lyhue1991/spark_tutorial"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current branch master is up to date.\r\n"
     ]
    }
   ],
   "source": [
    "!git rebase origin/master"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enumerating objects: 11, done.\n",
      "Counting objects: 100% (11/11), done.\n",
      "Delta compression using up to 4 threads\n",
      "Compressing objects: 100% (6/6), done.\n",
      "Writing objects: 100% (6/6), 1.40 KiB | 478.00 KiB/s, done.\n",
      "Total 6 (delta 5), reused 0 (delta 0)\n",
      "remote: Resolving deltas: 100% (5/5), completed with 4 local objects.\u001b[K\n",
      "To https://github.com/lyhue1991/spark_tutorial\n",
      "   b9c8f36..79dc949  master -> master\n",
      "Branch 'master' set up to track remote branch 'master' from 'origin'.\n"
     ]
    }
   ],
   "source": [
    "!git push -u origin master "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
